package com.sxjh.controller.cb;

import com.sxjh.common.BaseController;
import com.sxjh.common.Result;
import com.sxjh.config.Authorization;
import com.sxjh.entity.param.Finance10JcParam;
import com.sxjh.entity.param.Finance10Param;
import com.sxjh.entity.result.Finance10Result;
import com.sxjh.service.FinanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/balance")
@Api(tags = "余额报表")
public class Finance10Controller extends BaseController {

  @Autowired
  private FinanceService financeService;

  @ApiOperation("甲醇余额报表")
  @GetMapping("/jc")
  @Authorization("be.balance.jc")
  @Deprecated
  Result<List<Finance10Result>> jc(Finance10Param param) {
    param.setMaterialId(17);
    return ok(financeService.list27(param));
  }

  @ApiOperation("余额报表")
  @Authorization("be.balance")
  @GetMapping
  Result<List<Finance10Result>> list(Finance10JcParam param) {
    return ok(financeService.getCheckBalances(param));
  }

}